package com.tanhua.manager.job;

import com.tanhua.manager.service.AnalysisService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class AnalysisJob {

    @Autowired
    private AnalysisService analysisService;

    @Scheduled(cron = "0 0 0/1 * * ?")
    public void analysis() {
        //定时分析tb_log表中的数据，把统计分析结果存储到tb_analysis_by_day表中
        log.info("定时数据分析任务开始");
        analysisService.analysis();
        log.info("定时数据分析任务结束");
    }
}
